﻿using System;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

// Token: 0x0200025A RID: 602
public class ConfirmationDialog : MonoBehaviour
{
	// Token: 0x06000D29 RID: 3369 RVA: 0x0006914C File Offset: 0x0006734C
	private void Awake()
	{
		this.gameController = GameController.Instance;
		this.yesButton.onClick.AddListener(new UnityAction(this.OnYes));
		this.noButton.onClick.AddListener(new UnityAction(this.OnNo));
	}

	// Token: 0x06000D2A RID: 3370 RVA: 0x0006919C File Offset: 0x0006739C
	public void Open(UnityAction yesCallback, UnityAction noCallback, string message)
	{
		this.yesCallback = yesCallback;
		this.noCallback = noCallback;
		this.messageText.text = message;
		base.gameObject.SetActive(true);
	}

	// Token: 0x06000D2B RID: 3371 RVA: 0x000691C4 File Offset: 0x000673C4
	private void OnYes()
	{
		if (this.yesCallback != null)
		{
			this.yesCallback();
		}
		base.gameObject.SetActive(false);
	}

	// Token: 0x06000D2C RID: 3372 RVA: 0x000691E8 File Offset: 0x000673E8
	private void OnNo()
	{
		if (this.noCallback != null)
		{
			this.noCallback();
		}
		base.gameObject.SetActive(false);
	}

	// Token: 0x06000D2D RID: 3373 RVA: 0x0006920C File Offset: 0x0006740C
	private void OnEnable()
	{
		this.gameController.SetIsTyping(true);
	}

	// Token: 0x06000D2E RID: 3374 RVA: 0x0006921A File Offset: 0x0006741A
	private void OnDisable()
	{
		this.gameController.SetIsTyping(false);
	}

	// Token: 0x04001230 RID: 4656
	private GameController gameController;

	// Token: 0x04001231 RID: 4657
	[SerializeField]
	private Button yesButton;

	// Token: 0x04001232 RID: 4658
	[SerializeField]
	private Button noButton;

	// Token: 0x04001233 RID: 4659
	[SerializeField]
	private Text messageText;

	// Token: 0x04001234 RID: 4660
	private UnityAction yesCallback;

	// Token: 0x04001235 RID: 4661
	private UnityAction noCallback;
}
